import { S, U, getRequestId, mapField } from '../../lib/backend'
import Q from 'q'
import axios from 'axios'
import env from '../../config/common'

export default {
  // 获取sms
  getInvalidList ({ dispatch, commit, state, rootState }, info) {
    const URL = env.CRM_API_HOST + '/admin/' + rootState.auth.user.token + '/sites/' + rootState.auth.site_id + '/invalid/list'
    // const URL = 'http://rap2api.taobao.org/app/mock/2717/GET/admin/[token]/sites/[site_id]/invalid/list'
    return axios.get(URL + '?' + U(info))
  },
  getTeamInvalidList ({ dispatch, commit, state, rootState }, info) {
    const URL = env.CRM_API_HOST + '/admin/' + rootState.auth.user.token + '/sites/' + rootState.auth.site_id + '/team/invalid'
    // const URL = 'http://rap2api.taobao.org/app/mock/2717/GET/admin/[token]/sites/[site_id]/team/invalid'
    return axios.get(URL + '?' + U(info))
  },
  getMemberInvalidList ({ dispatch, commit, state, rootState }, info) {
    const URL = env.CRM_API_HOST + '/admin/' + rootState.auth.user.token + '/sites/' + rootState.auth.site_id + '/suid/invalid'
    // const URL = 'http://rap2api.taobao.org/app/mock/2717/GET/admin/[token]/sites/[site_id]/suid/invalid'
    return axios.get(URL + '?' + U(info))
  },
}
